package org.pada.client.dto;

import java.util.Optional;

/**
 * @author shen.peng
 * @since 2024/10/12
 */
public class CursorQry<R, C> implements Qry<R> {
    private C cursor;

    private Integer limit = 5;

    public C getCursor() {
        return cursor;
    }

    public C getCursor(C c) {
        return Optional.ofNullable(cursor).orElse(c);
    }

    public void setCursor(C cursor) {
        this.cursor = cursor;
    }

    public Integer getLimit() {
        return limit;
    }

    public void setLimit(Integer limit) {
        this.limit = limit;
    }
}